package dao.domain;

import java.util.List;



/** 传递前后Hql 条件中的field条件,该类以field为单位
 *  最终条件为  "( ( (prject.department like '%一分%') or (prject.department like '%网优%') ) and ( (prject.classByProsssion like '%移动通信%') or (prject.classByProsssion like '%数据交换%') ) "
	其中:
	 fieldName = department
	 valueArray =['&一分','&二分']
	 fieldOperator='or'/'and' 默认是or
	 fieldType 保存该域的类型，因为涉及到是否需要''，以及能否><
	 tClassName:对应于后台的模型名称,对应于下面2种情况，1.和前台一致，2.复杂属性，需要查找pageClass-dictionary xml文件对应出来，
	 
	 存在2种情况
	1.是单对象查询，不涉及到join left
	  此时前台和后台模型一般是一致的,如 前台的Depatment.name  和  后台Tdepartment.name是相对应的，在转化成hql,不会存在问题
	2.负责属性，如project.departmentNames,涉及到后台的join left
	此时需要将FilterField 查表，根据查表的结果对应出tClassName和fieldType.  
	 
 * @author nsl
 *
 */
public class ConditionFilterField {
	
	private String fieldName;
	private List<String> values;
	private List<String> valueOperators;
	private String fieldType="string";
	private String modelClassName;//对应后台model className
	
	
	public ConditionFilterField() {
		super();
	}
	
	
	public ConditionFilterField(String fieldName, List<String> valueArray,
			List<String> valueOperators) {
		super();
		this.fieldName = fieldName;
		this.values = valueArray;
		this.valueOperators = valueOperators;
	}


	public ConditionFilterField(String fieldName, List<String> valueArray) {
		super();
		this.fieldName = fieldName;
		this.values = valueArray;
	}
	public String getFieldName() {
		return fieldName;
	}
	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}
	public List<String> getValues() {
		return values;
	}
	public void setValues(List<String> values) {
		this.values = values;
	}
	
	
	public List<String> getValueOperators() {
		return valueOperators;
	}
	public void setValueOperators(List<String> ValueOperators) {
		this.valueOperators = ValueOperators;
	}
	
	
	public String getFieldType() {
		return fieldType;
	}
	public void setFieldType(String fieldType) {
		this.fieldType = fieldType;
	}
	public String getModelClassName() {
		return modelClassName;
	}
	public void setModelClassName(String ModelClassName) {
		this.modelClassName = ModelClassName;
	}
	@Override
	public String toString() {
		return "FilterField [fieldName=" + fieldName + ", valueArray="
				+ values + ", fieldOperator=" + valueOperators
				+ ", fieldType=" + fieldType + ", ModelClassName=" + modelClassName
				+ "]";
	}
	
}
